<template>
  <el-card class="box-card">
    <bread data1="权限管理" data2='权限列表'></bread>
     <el-table
    :data="roleTab"
    stripe
    border
    height='450px'
    class="roleTab"
    style="width: 100%">
    <el-table-column
      label="#"
      width="60"
      type='index'>
    </el-table-column>
    <el-table-column
      prop="authName"
      label="权限名称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="path"
      label="路径"
      width="180">
    </el-table-column>
    <el-table-column
      label="层级">
      <template v-slot="scoped">
        {{ (scoped.row.level-0+1)+'级'}}
      </template>
    </el-table-column>
  </el-table>
</el-card>
</template>

<script>

export default {
  data () {
    return {
      roleTab: []
    }
  },
  created () {
    this.getRightList()
  },
  methods: {
    async getRightList () {
      const res = await this.$http.get('rights/list')
      this.roleTab = res.data.data
      //  console.log(this.roleTab)
    }
  }
}
</script>

<style lang="scss" scoped>
.roleTab{
  margin-top: 15px;
}
</style>
